package cn.gson.crm.model.pojos;

import javax.persistence.*;
import java.util.Objects;

@Entity
public class Cart {
    private long cartId;
    private Long cartNum;
    private String cartColor;
    private String cartSize;
    private String cartUnit;
    private String cartName;
    private double cartPrice;
    private int cartKcnum;
    public Sales sales;

    @Basic
    @Column(name = "cart_kcnum")
    public int getCartKcnum() {
        return cartKcnum;
    }

    public void setCartKcnum(int cartKcnum) {
        this.cartKcnum = cartKcnum;
    }

    @ManyToOne
    @JoinColumn(name = "sales_id2", referencedColumnName = "sales_id2")
    public Sales getSales() {
        return sales;
    }

    public void setSales(Sales sales) {
        this.sales = sales;
    }

    @Id
    @Column(name = "cart_id")
    @GeneratedValue(generator  =  "seq",strategy  =  GenerationType.SEQUENCE)
    //定义一个序列生成器
    @SequenceGenerator(name  =  "seq",sequenceName  =  "crm",
            initialValue  =  1,allocationSize  =  1)
    public long getCartId() {
        return cartId;
    }

    public void setCartId(long cartId) {
        this.cartId = cartId;
    }

    @Basic
    @Column(name = "cart_num")
    public Long getCartNum() {
        return cartNum;
    }

    public void setCartNum(Long cartNum) {
        this.cartNum = cartNum;
    }

    @Basic
    @Column(name = "cart_color")
    public String getCartColor() {
        return cartColor;
    }

    public void setCartColor(String cartColor) {
        this.cartColor = cartColor;
    }

    @Basic
    @Column(name = "cart_size")
    public String getCartSize() {
        return cartSize;
    }

    public void setCartSize(String cartSize) {
        this.cartSize = cartSize;
    }

    @Basic
    @Column(name = "cart_unit")
    public String getCartUnit() {
        return cartUnit;
    }

    public void setCartUnit(String cartUnit) {
        this.cartUnit = cartUnit;
    }

    @Basic
    @Column(name = "cart_name")
    public String getCartName() {
        return cartName;
    }

    public void setCartName(String cartName) {
        this.cartName = cartName;
    }

    @Basic
    @Column(name = "cart_price")
    public double getCartPrice() {
        return cartPrice;
    }

    public void setCartPrice(double cartPrice) {
        this.cartPrice = cartPrice;
    }

}
